package com.quktzhuanka.app.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.quktzhuanka.app.R;
import com.quktzhuanka.app.bean.OrderDetailBean;
import com.quktzhuanka.app.config.Constants;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import java.util.List;

public class MyOrderDetailAdapter extends CommonAdapter<OrderDetailBean.OrderDetail2> {
    public MyOrderDetailAdapter(Context context, int layoutId, List<OrderDetailBean.OrderDetail2> datas) {
        super(context, layoutId, datas);
    }

    @Override
    protected void convert(ViewHolder holder, final OrderDetailBean.OrderDetail2 orderDetailBean, final int position) {
        ImageView img = holder.getView(R.id.img_shop);
        Glide.with(mContext).load(Constants.APP_IP + orderDetailBean.img).error(R.drawable.no_banner).dontAnimate().into(img);
        holder.setText(R.id.txt_name, orderDetailBean.goods_name);
        holder.setText(R.id.txt_num, "X" + orderDetailBean.num);
        holder.setText(R.id.txt_price, "￥" + orderDetailBean.allprice);
//        holder.setText(R.id.txt_attribute,orderDetailBean.sku==null?"":Html.fromHtml(orderDetailBean.sku).toString());
    }

}
